#ifndef TC_IFTHENELSE_HPP
#define TC_IFTHENELSE_HPP

/** \file IfThenElse.hpp
 * Declarations for the class template IfThenElse.
 *
 * (c) Copyright  Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * The following code example is taken from the book
 * "C++ Templates - The Complete Guide", page 272
 * by David Vandevoorde and Nicolai M. Josuttis, Addison-Wesley, 2002
 *
 * (C) Copyright David Vandevoorde and Nicolai M. Josuttis 2002.
 * Permission to copy, use, modify, sell and distribute this software
 * is granted provided this copyright notice appears in all copies.
 * This software is provided "as is" without express or implied
 * warranty, and with no claim as to its suitability for any purpose.
 *
 * $Id: IfThenElse.hpp 119 2006-06-21 04:57:25Z semihc $
 *
 *
 */


#include "Global.hh"

namespace TC {

  /**
   * Primary template: 
   * Yield second or third argument depending on first argument
   */
  template<bool C, typename Ta, typename Tb>
  class IfThenElse;


  /**
   * Partial specialization: true yields second argument
   */
  template<typename Ta, typename Tb>
  class IfThenElse<true, Ta, Tb> 
  {
  public:
    typedef Ta ResultT;
    typedef Ta ResultType;
  };


  /** 
   * Partial specialization: false yields third argument
   */ 
  template<typename Ta, typename Tb>
  class IfThenElse<false, Ta, Tb> 
  {
  public:
    typedef Tb ResultT;
    typedef Tb ResultType;
  };


} // end namespace



#endif /* Include guard */
